{
	angular
		.module('httpModule')
		.factory('http.interfaces', interfaces);
	interfaces.$inject = ['http.sendRequest', 'utils.constant.url', '$q', '$state'];
	function interfaces(sendRequest, url, $q, $state) {
		let interfaces = {
			dormName:'',
			time:'',
			/**
			 * @desc 登录
			 * @param paramsObj:
			 * account  string  账号
			 * password  string  密码
			 * @returns {Promise}
			 */
			login: function (paramsObj) {
				return sendRequest(url.login, paramsObj);
			},
			logout: function (paramsObj) {
				let defered = $q.defer();
				sendRequest(url.logout, paramsObj).then(res=> {
					if(res.data.resultCode==1){
						$state.go('tab.login');
					}
					else {
						alert(res.data.message)
					}
				});
				return defered.promise;
			},
			schoolLeader: function (paramsObj) {
				return sendRequest(url.schoolLeader, paramsObj);
			},
			departStat: function (paramsObj) {
				return sendRequest(url.departStat, paramsObj);
			},
			departmentList: function (paramsObj) {
				return sendRequest(url.departmentList, paramsObj);
			},
			dormitoryList: function (paramsObj) {
				return sendRequest(url.dormitoryList, paramsObj);
			},
			dormStat: function (paramsObj) {
				return sendRequest(url.dormStat, paramsObj);
			},
			floorRooms: function (paramsObj) {
				return sendRequest(url.floorRooms, paramsObj);
			},
			roomInfo: function (paramsObj) {
				return sendRequest(url.roomInfo, paramsObj);
			},
			roomList: function (paramsObj) {
				return sendRequest(url.roomList, paramsObj);
			},
			specialtyList: function (paramsObj) {
				return sendRequest(url.specialtyList, paramsObj);
			},
			studentPageList: function (paramsObj) {
				return sendRequest(url.studentPageList, paramsObj);
			},
			studentList: function (paramsObj) {
				return sendRequest(url.studentList, paramsObj);
			},
			studentSearch: function (paramsObj) {
				return sendRequest(url.studentSearch, paramsObj);
			},
			floorList: function (paramsObj) {
				return sendRequest(url.floorList, paramsObj);
			},
			stayOutLate: function (paramsObj) {
				return sendRequest(url.stayOutLate, paramsObj);
			},
			outLateYesterday: function (paramsObj) {
				return sendRequest(url.outLateYesterday, paramsObj);
			},
			outLateStudents: function (paramsObj) {
				return sendRequest(url.outLateStudents, paramsObj);
			},
			records: function (paramsObj) {
				return sendRequest(url.records, paramsObj);
			}
		};
		return interfaces;
	}
}